package com.xingkeduo.config;

/**
 * @author chi  2019-05-09 20:30
 **/
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import static com.xingkeduo.config.WechatFilter.operateIdThreadLocal;

@Component
public class FeignInterceptor implements RequestInterceptor{

    /**
     * feign  统一添加header
     * @param requestTemplate
     */
    public void apply(RequestTemplate requestTemplate){
        requestTemplate.header("operator", operateIdThreadLocal.get()+"");
    }
}